package com.longge;

/**
 * @program: my-code
 * @description:
 * @author: longge
 * @create: 2021-03-09 01:13
 */
public class RemoveDuplicatesNums {
    public int removeDuplicates(int[] nums) {
        int slow = 1, fast = 1;
        while (fast != nums.length) {
            if (nums[fast - 1] != nums[fast]) {
                nums[slow++] = nums[fast];
            }
            fast++;
        }
        return slow;
    }

}
